/**
 * 后台工作流引擎使用数据模型
 */
import EventModel from "@/components-com/workflow/model/event.model";
import TaskModel from "@/components-com/workflow/model/task.model";
import SequenceModel from "@/components-com/workflow/model/sequence.model";
import GatewayModel from "@/components-com/workflow/model/gateway.model";
import Utils from "@/utils/utils";

export default class WorkflowModel extends EventModel {
    /**
     * 流程名称
     */
    name: string;
    /**
     * 备注
     */
    documentation: string;
    /**
     * 关联单据
     */
    formId: string;
    key: string;

    enabled: boolean;
    /**
     * 通知方式
     */
    emailNotice: boolean;
    siteNotice: boolean;
    /**
     * 开始事件
     */
    startEvent: EventModel;
    /**
     * 结束事件
     */
    endEvent: EventModel;

    taskList: TaskModel[];

    sequenceList: SequenceModel[];

    serviceTaskList: TaskModel[];
    /*网关列表*/
    gatewayList: GatewayModel[];

    /*待办通知开关*/
    toDoNoticeEnabled: boolean;

    /*待办通知标题*/
    toDoNoticeTitle: string;

    /*待办通知内容*/
    toDoNoticeContent: string;

    /*归档通知开关*/
    fileNoticeEnabled: boolean;

    /*归档通知标题*/
    fileNoticeTitle: string;

    /*归档通知内容*/
    fileNoticeContent: string;

    /*发起人通知开关*/
    sponsorNoticeEnabled: boolean;

    /*发起人通知标题*/
    sponsorNoticeTitle: string;

    /*发起人通知内容*/
    sponsorNoticeContent: string;

    /*知会通知开关*/
    ccNoticeEnabled: boolean;

    /*知会通知标题*/
    ccNoticeTitle: string;

    /*知会通知内容*/
    ccNoticeContent: string;


    constructor(id: string = Utils.uuid(),
                siteNotice: boolean = true,
                enabled: boolean = true,
                toDoNoticeEnabled: boolean = true,
                fileNoticeEnabled: boolean = true,
                sponsorNoticeEnabled: boolean = true,
                ccNoticeEnabled: boolean = true) {
        super(id);
        this.siteNotice = siteNotice;
        this.enabled = enabled;
    }
}
